package watch_cmd

import (
	"learning/gooop/spring/autogen/command"
)

// ListCmd calls service.WatchList
type ListCmd int

// ListCmdBuilder parse cli input and try to build a ListCmd instance
type ListCmdBuilder int

const gListCmdString1 = "watch list"
const gListCmdString2 = "watch ls"

var gListCmdSingleton = new(ListCmd)

func (me *ListCmd) String() string {
	return gListCmdString1
}

func (me *ListCmd) Apply(c command.ICmdContext) error {
	// todo:
	panic("implements me")
}

func (me *ListCmdBuilder) Build(line string) (error, command.ICmd) {
	if line != gListCmdString1 && line != gListCmdString2 {
		return nil, nil
	}

	return nil, gListCmdSingleton
}
